﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebmasterTool/Admin.Master" AutoEventWireup="true"
    CodeBehind="ManagerGroups.aspx.cs" Inherits="Framework.WebmasterTool.Memberships.ManagerGroups" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#chkAll").live("change", function () {
                if ($(this).is(":checked")) {
                    $(".checkbox").attr("checked", "checked");
                }
                else {
                    $(".checkbox").removeAttr("checked");
                }
            });
            $(".checkbox").live("click", function () {
                var allCheck = true;
                $(".checkbox").each(function () {
                    if (!$(this).is(":checked")) {
                        allCheck = false;
                        return;
                    }
                });
                if (allCheck == true) {
                    $("#chkAll").attr("checked", "checked");
                }
                else {
                    $("#chkAll").removeAttr("checked");
                }
            });
            $("#<%= btnDelete.ClientID %>").live("click", function () {
                var callFrom = $(this);
                jConfirm('Chắc chắn xoá?', 'Digisky Confirm Dialog',
                function (r) {
                    if (r) {
                        __doPostBack(callFrom.attr('name').replace(/_/g, '$'), '');
                    }
                });
                return false;
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ctlCaption" runat="Server">
    Quản lý nhóm thành viên
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageContent" runat="Server">
    <asp:Label ID="lblPermissionMessage" runat="server" Font-Bold="true" ForeColor="Red"
        Text="Tài khoản không có quyền truy cập vào trang này" Visible="false"></asp:Label>
    <asp:Panel ID="Panel1" runat="server" Visible="true">
        <br />
        <table width="750" align="center">
            <tr>
                <td>
                    <table width="100%">
                        <tr>
                            <td width="35%">
                                <asp:Button ID="btnCreateGroup" runat="server" Text="Tạo nhóm mới" OnClick="btnCreateGroup_Click" />
                                <asp:Button ID="btnManagerAccount" runat="server" Text="Quản lý thành viên" OnClick="btnManagerAccount_Click" />
                            </td>
                            <td align="right">
                                <span style="font-weight: bold">Tìm kiếm: </span>
                                <asp:TextBox ID="txtSearch" runat="server" ValidationGroup="Search" Width="150" />
                                <asp:Button ID="btnSearch" runat="server" ValidationGroup="Search" Text="Search"
                                    OnClick="btnSearch_Click" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center" style="padding-top: 5px;">
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:GridView runat="server" Width="100%" CssClass="grid" ID="grvGroup" AutoGenerateColumns="false"
                                AllowPaging="true" PageSize="10" AllowSorting="true" ToolTip="all" OnDataBinding="grvGroup_DataBinding"
                                OnPageIndexChanging="grvGroup_PageIndexChanging" OnSorting="grvGroup_Sorting">
                                <Columns>
                                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px">
                                        <HeaderTemplate>
                                            <input id="chkAll" type="checkbox" />
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <input id="chkSelect" runat="server" class="checkbox" type="checkbox" title='<%# Eval("RoleName") %>' />
                                        </ItemTemplate>
                                        <HeaderStyle Width="20px" />
                                        <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="RoleName" SortExpression="RoleName" HeaderStyle-Width="100"
                                        ItemStyle-Width="100" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                                        <ItemTemplate>
                                            <asp:Label ID="lblRoleName" runat="server" Text='<%# Eval("RoleName")%>'></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Left" Width="100px" />
                                        <ItemStyle HorizontalAlign="Left" Width="100px" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Mô tả" HeaderStyle-Width="300" ItemStyle-Width="300"
                                        HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                                        <ItemTemplate>
                                            <asp:Label ID="lblUsername" runat="server" Text='<%# Eval("Description")%>'></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Left" Width="300px" />
                                        <ItemStyle HorizontalAlign="Left" Width="300px" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Edit" ItemStyle-Width="20" HeaderStyle-Width="20"
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <a href="CreateGroup.aspx?RoleID=<%# Eval("RoleId") %>">
                                                <img src="<%= DGSFramework.Globals.ApplicationPath %>WebmasterTool/Images/Edit.gif"
                                                    alt="" border="0" />
                                            </a>
                                        </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Width="20px" />
                                        <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    </asp:TemplateField>
                                </Columns>
                                <EmptyDataTemplate>
                                    <table align="center" width="300" border="0">
                                        <tr>
                                            <td height="50" align="center">
                                                <div align="center">
                                                    Không có dữ liệu
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </EmptyDataTemplate>
                                <PagerSettings Mode="NumericFirstLast" />
                            </asp:GridView>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <br />
                    <asp:Button runat="server" ID="btnDelete" Text=" Xoá các nhóm đã chọn " OnClick="btnDelete_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
